package com.yorick.authority.modal.request.account;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.yorick.common.util.TrimmerDeserializer;
import lombok.*;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import java.util.List;

@Getter
@Setter
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class AccountAddRequest {
    @JsonProperty("account")
    @NotNull
    @Length(message = "账号不能超过个 {max} 字符", max = 18)
    @JsonDeserialize(using = TrimmerDeserializer.class)
    private String account;
    @NotNull
    @Length(message = "密码不能超过个 {max} 字符", max = 50)
    @JsonProperty("password")
    @JsonDeserialize(using = TrimmerDeserializer.class)
    private String password;
    @NotNull
    @Length(message = "名称不能超过个 {max} 字符", max = 10)
    @JsonProperty("username")
    @JsonDeserialize(using = TrimmerDeserializer.class)
    private String username;
    @Length(message = "手机号不能超过个 {max} 字符", max = 11)
    @JsonProperty("mobilephone")
    @JsonDeserialize(using = TrimmerDeserializer.class)
    private String mobilephone;
    @JsonProperty("roleList")
    private List<Integer> roleList;
    @JsonProperty("departmentList")
    private List<Integer> departmentList;
}
